﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SdlDotNet.Core;

namespace RenderTest1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
		RenderStack rs;
		public void button1_Click( object sender, EventArgs e )
		{
			rs = new RenderStack( new Size( 640, 480 ) );
			//SdlDotNet.Core.Events.MouseMotion += new ;
			SdlDotNet.Core.Events.MouseMotion += new EventHandler<SdlDotNet.Input.MouseMotionEventArgs>( Events_MouseMotion );
			SdlDotNet.Core.Events.MouseButtonUp += new EventHandler<SdlDotNet.Input.MouseButtonEventArgs>( Events_MouseButtonUp );
			SdlDotNet.Core.Events.Tick += new EventHandler<TickEventArgs>( Events_Tick );
			SdlDotNet.Core.Events.Quit += new EventHandler<QuitEventArgs>( Events_Quit );
			//SdlDotNet.Core.Events.EnableEvent
			SdlDotNet.Core.Events.Run();

			
			//while ( true )
			//{
				
			//    //rs.RegisterClick();
			//}
		}

		void Events_MouseButtonUp( object sender, SdlDotNet.Input.MouseButtonEventArgs e )
		{
			rs.RegisterClick(e);
		}

		void Events_Tick( object sender, TickEventArgs e )
		{
			rs.Render();
		}

		void Events_Quit( object sender, QuitEventArgs e )
		{
			//throw new NotImplementedException();
			SdlDotNet.Core.Events.Close();
		}

		void Events_MouseMotion( object sender, SdlDotNet.Input.MouseMotionEventArgs e )
		{
			//throw new NotImplementedException();
		}
    }
}
